<?php
$content=get_html($detail);//('http://item.taobao.com/auction/item_detail-0db1-d41d90b8c0998b73963f79439dadf9b9.jhtml?cm_cat=0');
//标题
$patten="/<title>(.*)<\/title>/i";
preg_match_all($patten,$content,$title,PREG_SET_ORDER);
if ($title) {
	$data['page']['title']=mb_convert_encoding($title[0][1],'utf-8','gbk');
	$data['page']['title']=str_ireplace('-淘宝网','',$data['page']['title']);
}
//图片
$patten="/<div class=\"pic s40\">(([\t   ]*\r\n.*)|(.*))<a href=\"#\"><img src=\"(.*)\" \/><\/a>/i";
preg_match_all($patten,$content,$pics,PREG_SET_ORDER);
if ($pics){
	foreach ($pics as $key=>$val){
		$data['pics'][$key]=str_ireplace('40x40','310x310',$val[4]);
	}
}else{
	$patten="/<img id=\"J_ImgBooth\" src=\"(.*)\"/i";
	preg_match_all($patten,$content,$pics,PREG_SET_ORDER);
	if ($pics){
		$data['pics'][]=$pics[0][1];
	}
}
//内容
$patten="/\"apiItemDesc\":\"(.*)\",/i";
preg_match_all($patten,$content,$descriptionUrl,PREG_SET_ORDER);
if ($descriptionUrl){
	$descriptionContent=get_html($descriptionUrl[0][1]);
	$descriptionContent=mb_convert_encoding($descriptionContent,'utf-8','gbk');
	$data['description']=str_ireplace(array("var desc='","\\","';"),array('','',''),$descriptionContent);
	$data['description']=strip_tags($data['description']);
}
//$data['description']=str_ireplace("</a>","",preg_replace("/<a[^>]+>/", "", $data['description']));;
tm_template('detail.html','shoppingbox');
?>